import {PAGE_SIZE} from '../components/constants';
import request from '../utils/request';

export async function fetch({page = 1}) {
  return request(`/api/users?_page=${page}&_limit=${PAGE_SIZE}`);
}

export async function remove({id}) {
  return request(`/api/users/${id}`, {
    method: "DELETE"
  })
}

export async function update({record}) {
  return request(`/api/users/${record.id}`, {
    method: "PATCH",
    body: JSON.stringify(record)
  })
}
